package com.gm.wj.dao;

import com.gm.wj.entity.SysTeacher;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SysTeacherDAO extends JpaRepository<SysTeacher,Integer> {
    SysTeacher findById(int id);

    // 多条件模糊查询
    @Query(value = "select * from sys_teacher  where  (?1 is null or enabled like ?1) and (?2 is null or tea_no like ?2) and (?3 is null or tea_name like ?3) and is_delete = 0",nativeQuery = true)
    List<SysTeacher> find(String queryKey1, String queryKey2, String queryKey3);
}
